import 'dart:ui';

import 'package:wallet/pages/main_page.dart';
import 'package:wallet/pages/start/guide_page.dart';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';


class WelcomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    SharedPreferences.getInstance().then((SharedPreferences prefs) {
      bool guide = prefs.getBool('guide') ?? false;
      if (!guide) {
        Navigator.of(context).pushReplacement(
            MaterialPageRoute(builder: (BuildContext context) => GuidePage()));
      } else {
        Navigator.of(context).pushReplacement(
            MaterialPageRoute(builder: (BuildContext context) => MainPage()));
      }
    });
    return Scaffold(
      body: Container(
        child: Center(
          child: Image.asset("assets/images/welcome/welcome.webp"),
        ),
      ),
    );
  }
}
